<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');
class login_model extends CI_Model
{
    public function login_model()
    {
        parent::__construct();
        if (!$this->isLogin()) {
            return redirect(site_url('auth/login'));
        }
    }

    public function isLogin()
    {
        if (!isset($_SESSION["CI_LOGIN"]) || $_SESSION["CI_LOGIN"] != 'ok') {
            return false;
        }
        return true;
    }

}
